# Set the minimum version of CMake that can be used
cmake_minimum_required(VERSION 3.0)

#project name  
project(Reactor_server)

set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wall")

set(CMAKE_BUILD_TYPE Debug)

set(SRC 
${PROJECT_SOURCE_DIR}/src/server.c
${PROJECT_SOURCE_DIR}/main.c
)

#PROJECT_SOURCE_DIR:当前工程目录下，如果没有install则创建。
set(EXECUTABLE_OUTPUT_PATH 
${PROJECT_SOURCE_DIR}/install
) 

# CMAKE_SOURCE_DIR: CMakeLists.txt 所在文件夹的绝对路径
include_directories(${CMAKE_SOURCE_DIR}/src) 

# 可执行文件生成
add_executable(${PROJECT_NAME} ${SRC})

# 链接linux自带的多线程共享库:pthread  --->相同于指定g++编译器-l参数
target_link_libraries(${PROJECT_NAME} pthread)


